<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script type="text/javascript">
function openReg(){
	$("#regemail").val("");
	$("#regyhmm").val("");
	$("#regyhmmagain").val("");
	$("#regDlg").show();
}
function closeReg(){
	$("#regDlg").hide();
}
function ClickReg(){
	var regemail=$("#regemail").val();
	var regyhmm=$("#regyhmm").val();
	var regyhmmagain=$("#regyhmmagain").val();
	if(regemail.trim()==""||regyhmm.trim()==""||regyhmmagain.trim()==""){
		alert("请正确输入注册信息");
	}
	if(regemail.trim()!=""&&regyhmm.trim()!=""&&regyhmmagain.trim()!=""&&regyhmm.trim()!=regyhmmagain.trim()){
		alert("两次输入密码不正确");
		$("#regyhmm").val("");
		$("#regyhmmagain").val("");
	}
	if(regemail.trim()!=""&&regyhmm.trim()!=""&&regyhmmagain.trim()!=""&&regyhmm.trim()==regyhmmagain.trim()){
	
		var email=$("#regemail");
		var yhmm=$("#regyhmm");
	    $.ajax({
		    url: "regYhxx.action",
		    type: "post",
		    data: "email="+email.val()+"&yhmm="+yhmm.val(),
		    datetype: "json",
		    success: function(date) {
		    	var flag=date.regflag;
		    	if(flag=="0"){
		    		alert("注册失败");
		    	}
		    	if(flag=="1"){
		    		window.location.reload(); 
		    	}
		    	
		     }
		 });
	}
}

</script>
       <div class="loginDiv" id="regDlg" style="display:none;"><!--注册框-->
      	<table width="491" style="height:200px; border:solid 3px #F30">
		<tbody>
		<tr>
  	    <td width="131" height="50"><h4 style="margin-left:-50px; margin-bottom:10px; ">新用户注册</h4>
        <i style="font-size:12px; margin-bottom:10px; color:#CCCCCC">请填写正确信息</i>		</td>
     	 <td width="178"><span style="float:right; margin-right:10px;"><a href="#" onclick="closeReg();">关闭</a></span></td>
    	</tr>
   		 <tr>
    	<th style="text-align:right"><i>*&nbsp;</i><span style="font-weight:100;">用户名/邮箱：</span></th>
   		  <td colspan="2">
    	   <input id="regemail" type="text" style="margin-left:-80px; height:20px;"/>
 	    </td>
  	  </tr>
  	  <tr>
	   <th style="text-align:right"><i>*&nbsp;</i><span style="font-weight:100;">密码：</span></th>
 	  <td><input id="regyhmm" type="password" style="margin-left:-80px; height:20px; "/></td>
    </tr>
      	  <tr>
	   <th style="text-align:right"><i>*&nbsp;</i><span style="font-weight:100;">重复密码：</span></th>
 	  <td><input id="regyhmmagain" type="password" style="margin-left:-80px; height:20px; "/></td>
    </tr>
    <tr>
    <th></th>
    <td><input onclick="ClickReg()" type="button" class="loginbt"  style="margin-left:10px;" value="注册"/></td>
    </tr>
    <tr></tr>
  </tbody>
</table>
</div><!--注册框end-->
   </div><!--main end-->
   
   
  